// 基础路径 注意发布之前要先修改这里
let baseUrl =process.env.NODE_ENV === "production" ? "./" : "/"
module.exports = {
    publicPath: baseUrl, // 根据你的实际情况更改这里
    lintOnSave: true,
    devServer: {
        disableHostCheck: true,
        publicPath: baseUrl, // 和 baseUrl 保持一致
         proxy: {
             '/app': {
                 target: 'http://127.0.0.1:5000',
                 ws: true,
                 pathRewrite: {
                     '^/app': '/app',
                 }
             }
             /*'/api': {
                 target: 'http://127.0.0.1:5000',
                 ws: true,
                 pathRewrite: {
                     '^/api': '/api',
                 }
             },
             '/sys': {
                 target: 'http://127.0.0.1:5000',
                 pathRewrite: {
                     '^/sys': '/sys',
                 }
             },
             '/login': {
                 target: 'http://127.0.0.1:5000',
             },
             '/logout': {
                 target: 'http://127.0.0.1:5000',
             },*/
         }

    },
    productionSourceMap: false,
    chainWebpack: (config) => {
        //忽略的打包文件
        config.externals({
            'vue': 'Vue',
            'vue-router': 'VueRouter',
            'vuex': 'Vuex',
            'axios': 'axios',
            'element-ui': 'ELEMENT',
        })
        const entry = config.entry('app')
        entry
            .add('babel-polyfill')
            .end()
        entry
            .add('classlist-polyfill')
            .end()
        entry
            .add('@/mock')
            .end()
    },
    transpileDependencies: ['avue-plugin-transfer', 'avue-plugin-ueditor'],
    //配置转发代理
   // devServer: {

    //}
}